import Home from '@pages/Home';

// 魔法注释
// 在懒加载的同时加入预加载
// 使代码加载速度更丝滑
const User = import(
  /* webpackPrefetch: true */
  /* webpackChunkName: 'User' */
  '../pages/User'
);
const Login = import(
  /* webpackPrefetch: true */
  /* webpackChunkName: 'Login' */
  '../pages/Login'
);

const routerConfig = [
  {
    path: '/',
    component: Home,
    exact: true,
  },
  {
    path: '/login',
    component: lazy(() => Login),

  },
  {
    path: '/user',
    component: lazy(() => User),
    auth: true,
  },
];
export default routerConfig;
